<?php
require('config.php');
		$start=0;
		$num=10;
		if(isset($_REQUEST['start'])) $start=$_REQUEST['start'];
		if(isset($_REQUEST['num'])) $num=$_REQUEST['num'];
		$sql="SELECT u.userPhone,g.goodsName FROM ".$oto."_orders as o,".$oto."_order_goods as g,".$oto."_users as u where o.orderId=g.orderId and o.orderStatus in ('0','1','2','3','4') and o.orderType='5' and o.winningCode is not null and o.userId=u.userId order by o.createTime DESC";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$orders[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($orders))
		{
			for($i=0;$i<count($orders);$i++)
			{
				$userPhone=$orders[$i]['userPhone'];
				$userPhone=str_split($userPhone);
				$userPhone2='';
				if(count($userPhone)<11)
				{
					$userPhone2=$userPhone[0];
					for($j=0;$j<count($userPhone);$j++)
					{
						$userPhone2.='*';
					}
				}
				else
				{
					$userPhone2=$userPhone[0].$userPhone[1].$userPhone[2];
					for($j=3;$j<count($userPhone)-4;$j++)
					{
						$userPhone2.='*';
					}
					$userPhone2.=$userPhone[count($userPhone)-4].$userPhone[count($userPhone)-3].$userPhone[count($userPhone)-2].$userPhone[count($userPhone)-1];
				}
				$orders[$i]['userPhone']=$userPhone2;
				$orders[$i]['msg']="恭喜".$orders[$i]['userPhone']."获得 ".$orders[$i]['goodsName'];
			}
		}
		if(isset($orders)) echo json_encode($orders);
		else echo '[]';
?>